export default {

    login(username, password) {
        return new Promise((resolve, reject) => {
            setTimeout(() => {
                let res = Math.random();
                if (res > .5) {
                    resolve(Promise.resolve(username +Date.now()))
                } else {
                    reject(Promise.reject('登录失败'))
                }
            }, 1000)
        })

    },
    setItem(key, value) {
        localStorage.setItem(key,value)
    },
    getItem(key) {
        return localStorage.getItem(key)
    }

}
